package com.enjoyor.soa.traffic.core.tpcms.mapper.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.enjoyor.soa.traffic.core.tpcms.constant.PassCheckSqlId;
import com.enjoyor.soa.traffic.core.tpcms.domain.PassCheck;
import com.enjoyor.soa.traffic.core.tpcms.mapper.IPassCheckMapper;
import com.enjoyor.soa.traffic.frame.support.mybatis.mapper.impl.BaseMapper;

@Service
@Transactional
public class PassCheckMapper extends BaseMapper<PassCheck> implements IPassCheckMapper {

    /*
     * @Override public void insert(PassCheck passApplyCheck) {
     * passApplyCheck.setCheckId("C" + String.valueOf(System.nanoTime()));
     * super.insert(passApplyCheck); }
     */

    @Override
    public List<PassCheck> getPassCheckList(Map<String, Object> map) {
        return sqlSessionTemplate.selectList(getSqlName(PassCheckSqlId.SQL_SELECT_LIST), map);
    }

    @Override
    public int updateByApplyId(String passApplyId) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("passApplyId", passApplyId);
        return sqlSessionTemplate.update(getSqlName(PassCheckSqlId.SQL_UPDATE_BYAPPLY), map);
    }
}
